import requests

url='https://www.baidu.com/'
h={
    'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36'
}
r=requests.get(url,headers=h)
with open('baidu.html','w',encoding='utf-8')as f:
    f.write(r.content.decode('utf-8'))
